package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Array9 {
    public static void main(String[] args) {
        int a[] = {12, 55, 10, 5, 14, 22, 23, 985, 52};
        int total = 0;
        for (int i : a) {
            total += i;
        }
        System.out.println(total);
        Scanner in = new Scanner(System.in);
        System.out.println("请输入要查找的数字：");
        int k = in.nextInt();
        //利用Return
        for (int i = 0; i < a.length; i++) {
            if (a[i] == k) {
                System.out.println("找到了,位置在" + (i + 1) + "处");
                return;
            }
        }
        System.out.println("不在！");
    }
}
